<template>
    <el-dialog :visible.sync="visible" v-dialogDrag :title="title" :close-on-click-modal="false" class="tl-dialog" width="600px" @open="open" @close="close">
        <el-form class="tl-form" ref="form" :model="model" :rules="rules" label-width="80px" :disabled="disableEditSubmit">
            <el-row>
                <el-col :span="24">
                    <el-form-item label="项目" prop="projectid">
                        <el-input v-model="model.dispprojectid" :readonly="true" class="is-disabled"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-form-item label="项目编号" prop="projectcode">
                        <el-input v-model="model.projectcode" :readonly="true" class="is-disabled"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-form-item label="日期" prop="calendardate">
                        <el-date-picker v-model="model.calendardate" type="date" placeholder="日期" value-format="yyyy-MM-dd" :disabled="true"></el-date-picker>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-form-item label="日历类型" prop="calendartype">
                        <el-select v-model="model.calendartype" filterable clearable>
                            <el-option v-for="item in codeModel.calendartypeList" :key="item.code" :label="item.name" :value="item.code" />
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-form-item label="备注" prop="description">
                        <el-input v-model="model.description" type="textarea" :rows="2"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <!-- <el-row>
				<el-col :span="12">
					<el-form-item label="排序码" prop="sortcode">
						<el-input-number v-model="model.sortcode" controls-position="right" :step="1" :min="0" style="width:100%"></el-input-number>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="有效" prop="enabled">
						<el-radio-group v-model="model.enabled">
							<el-radio :label="parseInt(item.code)" v-for="item in codeModel.enabledList" :key="item.code">{{ item.name }}</el-radio>
						</el-radio-group>
					</el-form-item>
				</el-col>
			</el-row> -->
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button :type="disableEditSubmit === false ? 'text' : 'primary'" @click="doCancelEdit">取消</el-button>
            <el-button type="primary" @click="doSubmitEdit" :loading="saveLoading" v-if="disableEditSubmit === false">
                <svg-icon icon-class="save" />保存</el-button>
        </div>
        <tlpm-project-ref ref="pmProjectRef" @confirm="getpmProjectRefData" :isSingleSelect="true"></tlpm-project-ref>
    </el-dialog>
</template>

<script>
/** mixins */
import { mixin_edit } from '@tapui/mixins/mixin_edit'
/** 子组件 */
import tlpmProjectRef from '@/views/ProjectManage/pmProject/refList.vue'
/** 工具类 */
import { putAction, getAction, postAction, deleteAction } from '@tapui/utils/http'
/** VUE配置 */
export default {
    mixins: [mixin_edit],
    components: { tlpmProjectRef },
    data() {
        return {
            moduleTitle: '项目日历',
            urlPrefix: '/pm/calendar/',
            url: {
                // 额外的url
            }
        }
    },
    props: {
        projectId: {
            type: [Number, String],
            default: function() {
                return ""
            }
        },
        editFlag: {
            type: Boolean,
            default: true
        }
    },
    methods: {
        loaded() {
            // 页面加载完毕执行
        },
        /** 打开项目参照 */
        openpmProjectRefDialog() {
            this.$refs.pmProjectRef.visible = true
        },
        /** 获取项目参数数据 */
        getpmProjectRefData(selectionRow, selectKey, selectionValue) {
            this.$set(this.model, 'projectid', selectionRow.id)
        }
    }
}
</script>

